package domd11;
class findmax{
    public static  <E extends Comparable<E>>E compara(E[] array){//静态
        E max=array[0];
        for (int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i])<0){
                max=array[i];
            }
        }
        return max;
    }
}
public class Test {
    public static void main(String[] args) {
        Integer[] arrays={1,56,23,5,10,81};
        //int max=findmax.<Integer>compara(arrays);
        int max=findmax.compara(arrays);
        System.out.println(max);
    }
}
class Mydai<E extends Comparable<E>>{
    public E compara(E[] array){
        E max=array[0];
        for (int i = 1; i < array.length; i++) {
            if(max.compareTo(array[i])<0){
                max=array[i];
            }
        }
        return max;
    }
}

